package com.lhj.springboot3.features.config;

import com.lhj.springboot3.features.bean.Cat;
import com.lhj.springboot3.features.bean.Dog;
import com.lhj.springboot3.features.bean.Pig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * @Description
 * @Author lhj
 * @Date 2024/6/23 17:41
 */
@Configuration
public class BeanConfiguration {

    @Profile("dev")
    @Bean
    public Cat cat() {
        return new Cat("tom", 1);
    }

    @Profile("test")
    @Bean
    public Dog dog() {
        return new Dog("janny", 2);
    }
    @Profile("prod")
    @Bean
    public Pig pig() {
        return new Pig("marry", 2);
    }
}
